<?php
namespace app\controllers;
use yii\web\Controller;
use yii\web\ViewAction;
use Yii;
use yii\web\Response;
class Test2Controller extends Controller
{

    //登录
    public $layout = false;
    public $cookie_file = './cookie.txt';
    public $enableCsrfValidation = false;
    public $cookie = './1.txt';

    function vloginImage ( $url , $data , $ucookie )
    { // 模拟登录获取Cookie函数
        $filname = '1.jpg';
        $curl = curl_init (); // 启动一个CURL会话
        $fp = fopen ( $filname , 'wb' );
        curl_setopt ( $curl , CURLOPT_URL , $url ); // 要访问的地址
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYPEER , 0 ); // 对认证证书来源的检查
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYHOST , 2 ); // 从证书中检查SSL加密算法是否存在
        curl_setopt ( $curl , CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT'] ); // 模拟用户使用的浏览器
        curl_setopt ( $curl , CURLOPT_FOLLOWLOCATION , 1 ); // 使用自动跳转
        curl_setopt ( $curl , CURLOPT_AUTOREFERER , 1 ); // 自动设置Referer
        curl_setopt ( $curl , CURLOPT_POST , 1 ); // 发送一个常规的Post请求
        curl_setopt ( $curl , CURLOPT_POSTFIELDS , $data ); // Post提交的数据包
        curl_setopt ( $curl , CURLOPT_COOKIEJAR , $ucookie ); // 存放Cookie信息的文件名称
        curl_setopt ( $curl , CURLOPT_COOKIEFILE , $ucookie ); // 读取上面所储存的Cookie信息
        curl_setopt ( $curl , CURLOPT_TIMEOUT , 30 ); // 设置超时限制防止死循环
        curl_setopt ( $curl , CURLOPT_HEADER , 0 ); // 显示返回的Header区域内容
        curl_setopt ( $curl , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        curl_setopt ( $curl , CURLOPT_FILE , $fp );//tupian
        $tmpInfo = curl_exec ( $curl ); // 执行操作
        fclose ( $fp );
        if (curl_errno ( $curl )) {
            echo 'Errno' . curl_error ( $curl );
        }
        curl_close ( $curl ); // 关闭CURL会话
        return $tmpInfo; // 返回数据
    }


    public function actionBai ()
    {
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A944.tmp';
        $this->vget('http://ptlogin2.qq.com/jump?clientuin=980167048&keyindex=9&pt_aid=549000912&daid=5&u1=http://qzs.qq.com/qzone/v5/loginsucc.html?para=izone&specifyurl=http%3A%2F%2Fuser.qzone.qq.com%2F271699212&clientkey=000157A02CEB0068DEE7C8F54C28C4B14CBC1650A27D11B303CCE2074FFEACA1A8AADDEBB00F4EA7EABDC83A195E749BF8ED48D47D9C8C83381564CF87225555BA026DA20AE5CC47E3E2CDE67A0BB21C792961CE95792F0B03BE7F031741073F4D36DE1FE9AB359D26F662342D53F629&pt_3rd_aid=0&ptopt=1&style=40',$lines);
        $get='http://qzs.qq.com/qzone/v5/loginsucc.html?para=izone&specifyurl=http://user.qzone.qq.com/271699212';
        $this->vget($get,$lines);
       $url="http://user.qzone.qq.com/980167048";
        return $this->vpost($url,$lines);
        #获取token,
//        stream_socket_server()
//        tokenReturn = urllib2.urlopen(URL_BAIDU_TOKEN)
//
//matchVal =memcache_add_server(?P<tokenVal>.*?)"',tokenReturn.read())
//tokenVal = matchVal.group('tokenVal')
//        $post=array(
//            'username' => $username,
//            'password' => $password,
//            'u' => 'https://passport.baidu.com/',
//            'tpl' => 'pp',
//            'token' => $tokenVal,
//            'staticpage' => 'https://passport.baidu.com/static/passpc-account/html/v3Jump.html',
//            'isPhone' => 'false',
//            'charset' => 'UTF-8',
//            'callback' => 'parent.bd__pcbs__ra48vi'
//        );
       // $socket = stream_socket_server("tcp://0.0.0.0:8000", $errno, $errstr);
//        $conn=stream_socket_accept($socket);
//        var_dump($conn);
//        if (!$socket) {
//            echo "$errstr ($errno)<br />\n";
//        } else {
//            while ($conn = stream_socket_accept($socket)) {
//                fwrite($conn, 'The local time is ' . date('n/j/Y g:i a') . "\n");
//                fclose($conn);
//            }
//            fclose($socket);
//        }
    }

    public function actionTest1 ()
    {

        //登录地址
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A90.tmp';
        if (\Yii::$app->request->isPost) {

            $UserName = $entered_imagecode = \Yii::$app->request->post ( 'entered_login' );;
            $Password = $entered_imagecode = \Yii::$app->request->post ( 'entered_password' );;
            $entered_imagecode = \Yii::$app->request->post ( 'entered_imagecode' );
            $post_fields = array (
                'appid' => 12 ,
                'entered_login' => $UserName ,
                'entered_password' => $Password ,
                'entered_imagecode' => $entered_imagecode ,
                'charset' => 'utf-8' ,
                'fromu' => 'http://tongji.baidu.com/web/welcome/index' ,
                'selfu' => 'http://tongji.baidu.com/web/welcome/login' ,
                'senderr' => '1'
            );
            $login_url = 'https://cas.baidu.com/?action=login';
            //获取登录成功cookie
            $this->vlogin ( $login_url , $post_fields , $lines );
            //拿着cookie
            $indexurl = 'http://sitecenter.baidu.com/sc-web';
            return $this->vlogin ( $indexurl , 1 , $lines );
        } else {
            $cookie_folder = dirname ( __FILE__ ) . "/temp";
            $lines = $cookie_folder . '/coo3A90.tmp';
            $url1 = 'http://cas.baidu.com/?action=image&key=1459409074';
            $this->vloginImage ( $url1 , 1 , $lines );
            echo "<img  src='http://y.com/1.jpg'>";
            echo "
<form action='' method='post'>
<input type='text' name='entered_login' placeholder='帐号'/><br/>
<input type='text' name='entered_password' placeholder='密码'/><br/>
<input type='text' name='entered_imagecode' />
 <input type='submit' />
</form>";
        }
    }

    public function actionAdd ()
    {
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A90.tmp';
        $url = Yii::$app->request->get ( 'url' );
        $post = array (
            'url' => $url ,
            'reportId' => '1' ,
            'method' => 'home/site/save' ,
            'validateToken' => '76c49d37bc7c37397568ac37d300'
        );
        $urlpost = 'url=www.pin100.com&reportId=1&method=home%2Fsite%2Fsave&validateToken=76c49d37bc7c37397568ac37d300';
        $fileData = file_get_contents ( $lines );
        $f = '/LOGINUID.*?#HttpOnly/is';
        preg_match_all ( $f , $fileData , $msgData );
        $h = '/[0-9]+/is';
        preg_match_all ( $h , $msgData[0][0] , $returnData );
        $post = http_build_query ( $post );
        $url = 'http://sitecenter.baidu.com/sc-web/' . $returnData[0][0] . '/ajax/post';
        // $good='http://sitecenter.baidu.com/sc-web/9855448/ajax/post';
        echo $this->vlogin ( $url , $post , $lines );
    }

    //统计pv
    public function actionTest2 ()
    {
        $a = strtotime ( date ( 'Y-m-d' , time () ) );
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A90.tmp';
        $id = Yii::$app->request->get ( 'id' );
        $data = array (
            'clientDevice' => 'all' ,
            'et' => ($a + 60 * 60) * 1000 ,
            'et2' => 0 ,
            'flag' => 'today' , 'gran' => 6 ,
            'indicators' => 'pv_count,visitor_count,ip_count,bounce_ratio,avg_visit_time' ,
            'method' => 'trend/time/a' ,
            'offset' => 0 ,
            'order' => 'simple_date_title,desc' ,
            'pageSize' => 24 ,
            'queryId' => '' ,
            'reportId' => 3 ,
            'siteId' => $id ,
            'st' => ($a + 60 * 60) * 1000 ,
            'st2' => 0 );
        $fileData = file_get_contents ( $lines );
        $f = '/LOGINUID.*?#HttpOnly/is';
        preg_match_all ( $f , $fileData , $msgData );
        $h = '/[0-9]+/is';
        preg_match_all ( $h , $msgData[0][0] , $returnData );
        $data = http_build_query ( $data );
        $url = 'http://tongji.baidu.com/web/' . $returnData[0][0] . '/ajax/post';
        $dataArray = $this->vlogin ( $url , $data , $lines );
        $returnArray = json_decode ( $dataArray , true );
        $dataSum = $returnArray['data']['sum'][0];
        return $this->render ( 'sum' , [ 'data' => $dataSum ] );
    }
    public function actionApps()
    {
        $url="http://maps.google.cn/maps/api/js/GeocodeService.Search?4s%E6%9C%9B%E4%BA%ACsoho&7sCN&9szh-CN&callback=_xdc_._g5lwws&token=120883";
        return $this->vget($url,'');
    }
    public function actionT2 ()
    {
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A90.tmp';
        $indexurl = 'http://sitecenter.baidu.com/sc-web';
        $a = $this->vlogin ( $indexurl , 1 , $lines );
        //$tan='/multipleSiteResourceList>.*?multipleSiteList/m';
        $tan = '/multipleSiteResourceList.*?"m/si';
        preg_match_all ( $tan , $a , $lins );
        //取出
        $tt = '/\[{".*?"}\]/si';
        preg_match_all ( $tt , $lins[0][0] , $array );
        $url = "http://tongji.baidu.com/web/9855448/overview/index?siteId=";
        $return = json_decode ( $array[0][0] , true , '512' , JSON_BIGINT_AS_STRING );
//        foreach($return as $k=>$v)
//        {
//           $return[$k]['tokenurl']=$url.$v['id'];
//        }
        return $this->render ( 'index' , [ 'data' => $return ] );
//        $tan='/"items":.*?,"authSiteList"/m';
////        $tan='/multipleSiteResourceList.*?"m/si';
//        preg_match_all($tan,$a,$lins);
//        var_dump($lins);die();
    }

    public function curl_get ( $url , $cookie_path = NULL , $is_redirect = FALSE , $refer = NULL , $proxy = NULL , $timeout = NULL )
    {
        $ch = curl_init ( $url );

        if (is_null ( $timeout )) {
            $timeout = 30;
        }
        curl_setopt ( $ch , CURLOPT_TIMEOUT , $timeout );
        if (!is_null ( $cookie_path )) {
            curl_setopt ( $ch , CURLOPT_COOKIEFILE , $cookie_path );
            curl_setopt ( $ch , CURLOPT_COOKIEJAR , $cookie_path );
        }
        if ($is_redirect) {
            curl_setopt ( $ch , CURLOPT_FOLLOWLOCATION , 1 );    //是否抓取跳转后的页面
        }
        if (!is_null ( $refer )) {
            curl_setopt ( $ch , CURLOPT_REFERER , $refer );
        }
        if (!is_null ( $proxy )) {
            curl_setopt ( $ch , CURLOPT_HTTPPROXYTUNNEL , true );
            curl_setopt ( $ch , CURLOPT_PROXY , $proxy );
            curl_setopt ( $ch , CURLOPT_PROXYTYPE , CURLPROXY_HTTP );
        }
        if ($proxy == 3) {
            curl_setopt ( $ch , CURLOPT_HEADER , 1 );
        }
        curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , true ); //获取数据返回
        curl_setopt ( $ch , CURLOPT_BINARYTRANSFER , true ); //在启用 CURLOPT_RETURNTRANSFER 时候将获取数据返回
        curl_setopt ( $ch , CURLOPT_USERAGENT , "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" );
        curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        $tmpInfo = curl_exec ( $ch ); // 执行操作
        if (curl_errno ( $ch )) {
            echo 'Errno' . curl_error ( $ch );
        }
        curl_close ( $ch ); // 关键CURL会话
        return $tmpInfo; // 返回数据
    }

    public function actionAli ()
    {

        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A90.tmp';
        $url = 'https://login.taobao.com/member/login.jhtml?style=mini&from=alimama&redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3d1&full_redirhttps://login.taobao.com/member/login.jhtml?style=mini&from=alimama&redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3d1&full_redirect=true&disableQuickLogin=trueect=true&disableQuickLogin=true';
        echo $this->vlogin ( $url , '' , $lines );
    }


    function vpost ( $url , $data )
    { // 模拟提交数据函数
        $curl = curl_init (); // 启动一个CURL会话
        curl_setopt ( $curl , CURLOPT_URL , $url ); // 要访问的地址
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYPEER , 0 ); // 对认证证书来源的检查
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYHOST , 2 ); // 从证书中检查SSL加密算法是否存在
        curl_setopt ( $curl , CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT'] ); // 模拟用户使用的浏览器
        curl_setopt ( $curl , CURLOPT_FOLLOWLOCATION , 1 ); // 使用自动跳转
        curl_setopt ( $curl , CURLOPT_AUTOREFERER , 1 ); // 自动设置Referer
        curl_setopt ( $curl , CURLOPT_POST , 1 ); // 发送一个常规的Post请求
        curl_setopt ( $curl , CURLOPT_POSTFIELDS , $data ); // Post提交的数据包
        curl_setopt ( $curl , CURLOPT_COOKIEFILE , 1 ); // 读取上面所储存的Cookie信息
        curl_setopt ( $curl , CURLOPT_TIMEOUT , 30 ); // 设置超时限制防止死循环
        curl_setopt ( $curl , CURLOPT_HEADER , 0 ); // 显示返回的Header区域内容
        curl_setopt ( $curl , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        $tmpInfo = curl_exec ( $curl ); // 执行操作
        if (curl_errno ( $curl )) {
            echo 'Errno' . curl_error ( $curl );
        }
        curl_close ( $curl ); // 关键CURL会话
        return $tmpInfo; // 返回数据
    }

    function vget ( $url , $ucookie )
    { // 模拟登录获取Cookie函数

        $curl = curl_init (); // 启动一个CURL会话
        curl_setopt ( $curl , CURLOPT_URL , $url ); // 要访问的地址
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYPEER , 0 ); // 对认证证书来源的检查
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYHOST , 2 ); // 从证书中检查SSL加密算法是否存在
        curl_setopt ( $curl , CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT'] ); // 模拟用户使用的浏览器
        curl_setopt ( $curl , CURLOPT_FOLLOWLOCATION , 1 ); // 使用自动跳转
        curl_setopt ( $curl , CURLOPT_AUTOREFERER , 1 ); // 自动设置Referer
        curl_setopt ( $curl , CURLOPT_COOKIEJAR , $ucookie ); // 存放Cookie信息的文件名称
        curl_setopt ( $curl , CURLOPT_COOKIEFILE , $ucookie ); // 读取上面所储存的Cookie信息
        curl_setopt ( $curl , CURLOPT_TIMEOUT , 30 ); // 设置超时限制防止死循环
        curl_setopt ( $curl , CURLOPT_HEADER , 0 ); // 显示返回的Header区域内容
        curl_setopt ( $curl , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        $tmpInfo = curl_exec ( $curl ); // 执行操作
        if (curl_errno ( $curl )) {
            echo 'Errno' . curl_error ( $curl );
        }
        curl_close ( $curl ); // 关闭CURL会话
        return $tmpInfo; // 返回数据
    }

    function vlogin ( $url , $data , $ucookie )
    { // 模拟登录获取Cookie函数

        $curl = curl_init (); // 启动一个CURL会话
        curl_setopt ( $curl , CURLOPT_URL , $url ); // 要访问的地址
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYPEER , 0 ); // 对认证证书来源的检查
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYHOST , 2 ); // 从证书中检查SSL加密算法是否存在
        curl_setopt ( $curl , CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT'] ); // 模拟用户使用的浏览器
        curl_setopt ( $curl , CURLOPT_FOLLOWLOCATION , 1 ); // 使用自动跳转
        curl_setopt ( $curl , CURLOPT_AUTOREFERER , 1 ); // 自动设置Referer
        curl_setopt ( $curl , CURLOPT_POST , 1 ); // 发送一个常规的Post请求
        curl_setopt ( $curl , CURLOPT_POSTFIELDS , $data ); // Post提交的数据包
        curl_setopt ( $curl , CURLOPT_COOKIEJAR , $ucookie ); // 存放Cookie信息的文件名称
        curl_setopt ( $curl , CURLOPT_COOKIEFILE , $ucookie ); // 读取上面所储存的Cookie信息
        curl_setopt ( $curl , CURLOPT_TIMEOUT , 30 ); // 设置超时限制防止死循环
        curl_setopt ( $curl , CURLOPT_HEADER , 0 ); // 显示返回的Header区域内容
        curl_setopt ( $curl , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        $tmpInfo = curl_exec ( $curl ); // 执行操作
        if (curl_errno ( $curl )) {
            echo 'Errno' . curl_error ( $curl );
        }
        curl_close ( $curl ); // 关闭CURL会话
        return $tmpInfo; // 返回数据
    }
    public function actionTao()
    {
        $cookiefile=dirname ( __FILE__ ) . "/temp/00q.temp";
        echo $cookiefile;
        //1.第一步淘宝的密码用了AES加密算法，最终将密码转化为256位，在POST时，传输的是256位长度的密码。
          array(
              'ua' => '061#ULViDJiqiKViBJiyiiiiiVsBSomomPJhWiPccOE4Ki/DWDDpDzrLio1rSMi3n5fFbr5+L+E0Kn5YqtKODcfC/39Qa2YAm6n/iirpOSETRG3ginildB8isKwoq+TRTb3AB9JhRNR3/sViRG9Sd5UmG23G16n/iirpOkETs/hIiniUwGZ9YJyw52/QdsVix10AffzXi5Uy9Mc+4qnHpRCVs0h9qEsZ4e0YGsVi/IoWinVsiniVAwSncXc/iQhbJkwT2TuVnUruoXjdwfurcgIA2DXLFgymdtqkkj2gpYOheTjdwfurcgIdCN+epieg1DAvACrqmIdELCbHozmiHc12v8ZlfnUYgM9JweYRuo6TAXw2vHyldUXH2tXefnUYgMPaeTuinEEloD51afHKFrN6Zte7pLZxctT6S8ruFk1goD51afHKFYPb3KRA0zXhde8PZ8/VrpgwatP2oz/0lfOeavW9iJggTTZPtDf9m26ToNIvwfUmcHIkZt09iJgg' ,
              'TPL_password_2' => '20daeca642295550cdc2319fd987cd0bb8b1abc1b7228e9ec53750ef8a16283fa9828bab9c226e42fa3a7482b709f6c6b2af9cb5981470b4506770645d6dad03d10b12b579ca68be55723c7a916cb409a891806f9b93d307e06768c9c7a575849ba5c8e2000aaf1131a3f20c47401cefb88599fd27d819a47f262a2ca1456152' ,

          );
        //2.淘宝在登录时必须要输入验证码，在经过几次尝试失败后最终获取了验证码图片让用户手动输入来验证
        //跳过
        //3.淘宝另外有复杂且每天在变的 ua 加密算法，在程序中我们需要提前获取某一 ua 码才可进行模拟登录

       // 4. 在获取最后的登录 st 码时，历经了多次请求和正则表达式提取，且 st 码只可使用一次。
//        1.zhatoken
        $url='http://www.alimama.com/member/ajax_login.htm?forward=http://www.alimama.com/index.htm&callback=__jp1';
        $this->vget($url,$cookiefile);
        $get3 = 'https://log.mmstat.com/member.2.1.2?ok=1';
        $this->vget ( $get3 , $cookiefile );
    }
    public function actionIndex ()
    {
        //打开登陆
        echo '<div class="scale_text scale_text2" id="_scale_text"><span data-nc-lang="_yesTEXT" class="nc-lang-cnt"><b>验证通过</b></span></div>';
//        $aurl = 'https://login.taobao.com/member/login.jhtml';
//        $post_file = array (
//            'TPL_username' => '13271215815' ,
//            'TPL_password' => '' ,
//            'ncoSig' => '' ,
//            'ncoSessionid' => '' ,
//            'ncoToken' => '109373b382bf5de78d6f2b4609c932c42772c2f3' ,
//            'slideCodeShow' => 'false' ,
//            'loginsite' => '0' ,
//            'newlogin' => '' ,
//            'TPL_redirect_url' => 'https://www.taobao.com/' ,
//            'from' => 'alimama' ,
//            'fc' => 'default' ,
//            'style' => 'default' ,
//            'css_style' => '' ,
//            'keyLogin' => 'false' ,
//            'qrLogin' => 'true' ,
//            'newMini' => 'false' ,
//            'newMini2' => 'false' ,
//            'tid' => '' ,
//            'loginType' => '3' ,
//            'minititle' => '' ,
//            'minipara' => '' ,
//            'pstrong' => '' ,
//            'sign' => '' ,
//            'need_sign' => '' ,
//            'isIgnore' => '' ,
//            'full_redirect' => '' ,
//            'popid' => '' ,
//            'callback' => '' ,
//            'guf' => '' ,
//            'not_duplite_str' => '' ,
//            'need_user_id' => '' ,
//            'poy' => '' ,
//            'gvfdcname' => '10' ,
//            'gvfdcre' => '' ,
//            'from_encoding' => '' ,
//            'sub' => 'false' ,
//            'TPL_password_2' => '20daeca642295550cdc2319fd987cd0bb8b1abc1b7228e9ec53750ef8a16283fa9828bab9c226e42fa3a7482b709f6c6b2af9cb5981470b4506770645d6dad03d10b12b579ca68be55723c7a916cb409a891806f9b93d307e06768c9c7a575849ba5c8e2000aaf1131a3f20c47401cefb88599fd27d819a47f262a2ca1456152' ,
//            'loginASR' => '1' ,
//            'loginASRSuc' => '0' ,
//            'allp' => '' ,
//            'oslanguage' => 'zh-CN' ,
//            'sr' => '1366*768' ,
//            'osVer' => 'windows|6.1' ,
//            'naviVer' => 'firefox|45' ,
//            'ua' => '061#ULViDJiqiKViBJiyiiiiiVsBSomomPJhWiPccOE4Ki/DWDDpDzrLio1rSMi3n5fFbr5+L+E0Kn5YqtKODcfC/39Qa2YAm6n/iirpOSETRG3ginildB8isKwoq+TRTb3AB9JhRNR3/sViRG9Sd5UmG23G16n/iirpOkETs/hIiniUwGZ9YJyw52/QdsVix10AffzXi5Uy9Mc+4qnHpRCVs0h9qEsZ4e0YGsVi/IoWinVsiniVAwSncXc/iQhbJkwT2TuVnUruoXjdwfurcgIA2DXLFgymdtqkkj2gpYOheTjdwfurcgIdCN+epieg1DAvACrqmIdELCbHozmiHc12v8ZlfnUYgM9JweYRuo6TAXw2vHyldUXH2tXefnUYgMPaeTuinEEloD51afHKFrN6Zte7pLZxctT6S8ruFk1goD51afHKFYPb3KRA0zXhde8PZ8/VrpgwatP2oz/0lfOeavW9iJggTTZPtDf9m26ToNIvwfUmcHIkZt09iJgg' ,
//            'um_token' => 'HV01PAAZ0ab2a1c1246e0df3570625d500054482'
//        );
//        $url = 'https://login.taobao.com/member/login.jhtml';
//        $a = http_build_query ( $post_file );
////$post_file = 'TPL_username=tb26580038&TPL_password=zxc123...';
//        echo $this->vlogins ( $aurl , $a );
    }

    function vlogins ( $url , $data )
    { // 模拟登录获取Cookie函数
        $cookie_file = 'D:\cookie.txt';
        $curl = curl_init (); // 启动一个CURL会话
        curl_setopt ( $curl , CURLOPT_URL , $url ); // 要访问的地址
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYPEER , 0 ); // 对认证证书来源的检查
        curl_setopt ( $curl , CURLOPT_SSL_VERIFYHOST , 2 ); // 从证书中检查SSL加密算法是否存在
        curl_setopt ( $curl , CURLOPT_USERAGENT , $_SERVER['HTTP_USER_AGENT'] ); // 模拟用户使用的浏览器
        curl_setopt ( $curl , CURLOPT_FOLLOWLOCATION , 0 ); // 使用自动跳转
        curl_setopt ( $curl , CURLOPT_AUTOREFERER , 1 ); // 自动设置Referer
        curl_setopt ( $curl , CURLOPT_POST , 1 ); // 发送一个常规的Post请求
        curl_setopt ( $curl , CURLOPT_POSTFIELDS , $data ); // Post提交的数据包
        curl_setopt ( $curl , CURLOPT_COOKIEJAR , $cookie_file ); // 存放Cookie信息的文件名称
        curl_setopt ( $curl , CURLOPT_COOKIEFILE , $cookie_file ); // 读取上面所储存的Cookie信息
        curl_setopt ( $curl , CURLOPT_TIMEOUT , 30 ); // 设置超时限制防止死循环
        curl_setopt ( $curl , CURLOPT_HEADER , 0 ); // 显示返回的Header区域内容
        curl_setopt ( $curl , CURLOPT_RETURNTRANSFER , 1 ); // 获取的信息以文件流的形式返回
        $tmpInfo = curl_exec ( $curl ); // 执行操作
        if (curl_errno ( $curl )) {
            echo 'Errno' . curl_error ( $curl );
        }
        curl_close ( $curl ); // 关闭CURL会话
        return $tmpInfo; // 返回数据
    }

    public function actionBaidu ()
    {
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A91.tmp';
        $url = "https://passport.baidu.com/v2/api/?login";
        if (Yii::$app->request->isPost) {

            $a = Yii::$app->request->post ();
            $a = http_build_query ( $a );
            $urlstr = 'staticpage=http%3A%2F%2Fwww.baidu.com%2Fcache%2Fuser%2Fhtml%2Fv3Jump.html&charset=UTF-8&token=311834c031e9fb5f58b8da6696336141&tpl=mn&subpro=&apiver=v3&tt=1460449899085&codestring=&safeflg=0&u=http%3A%2F%2Fwww.baidu.com%2Fbaidu%3Fwd%3D%25BA%25C3%25D2%25BD%25C9%25FA%26tn%3Dmonline_4_dg&isPhone=&detect=1&gid=36F4BFD-DE88-48AF-BAF0-1BC7C9664F9F&quick_user=0&logintype=dialogLogin&logLoginType=pc_loginDialog&idc=&loginmerge=true&splogin=rate&username=13271215815&password=FEzDyNw0uQF86PCoYocDbg2VpkyQIQoV6A6YbBuaBQypA5PcCzTGLj9DT3R%2FttoGqXw9LyKsaZrLJiddxyYfaLBIKlCwF%2BX1Na4uv81p%2BHyN4mnEDnPoYlyZGzLGdH9%2FXQX8KunZz3R3jUu6OQm3J2d8Z%2FI0OJZCcfy%2BwxTBmjE%3D&verifycode=&mem_pass=on&rsakey=SzLw7epbp9DJ8aQP3UWwVWRTT3ZGVSSj&crypttype=12&ppui_logintime=76324&countrycode=&callback=parent.bd__pcbs__7asvbv';
            return $this->vlogin ( $url , $urlstr , $lines );
        } else {

            echo '<form autocomplete="off" method="POST" class="pass-form pass-form-normal" id="TANGRAM__PSP_8__form"><p class="pass-generalErrorWrapper" id="TANGRAM__PSP_8__errorWrapper"><span class="pass-generalError pass-generalError-error" id="TANGRAM__PSP_8__error"></span></p><p style="display:none;" class="pass-make-text" id="TANGRAM__PSP_8__MakeTextWrapper"></p><p id="TANGRAM__PSP_8__smsSwitchWrapper" class="pass-smsSwitchWrapper"><a id="TANGRAM__PSP_8__smsSwitch" data-type="sms" title="短信快捷登录" class="pass-sms-btn">短信快捷登录</a></p><p style="display:none" id="TANGRAM__PSP_8__hiddenFields"><input type="hidden" value="" name="codeString" id="TANGRAM__PSP_8__codeString"><input type="hidden" value="0" name="safeFlag" id="TANGRAM__PSP_8__safeFlag"><input type="hidden" value="https://www.baidu.com/" name="u" id="TANGRAM__PSP_8__u"><input type="hidden" value="" name="isPhone" id="TANGRAM__PSP_8__isPhone"><input type="hidden" value="1" name="detect" id="TANGRAM__PSP_8__detect"><input type="hidden" value="A0E437E-3F83-4CBA-BA0D-66F8F0FAED1D" name="gid" id="TANGRAM__PSP_8__gid"><input type="hidden" value="https://www.baidu.com/cache/user/html/v3Jump.html" name="staticPage" id="TANGRAM__PSP_8__staticPage"><input type="hidden" value="0" name="quick_user" id="TANGRAM__PSP_8__quick_user"><input type="hidden" value="dialogLogin" name="logintype" id="TANGRAM__PSP_8__logintype"><input type="hidden" value="pc_loginDialog" name="logLoginType" id="TANGRAM__PSP_8__logLoginType"><input type="hidden" value="" name="subpro" id="TANGRAM__PSP_8__subpro"><input type="hidden" value="" name="idc" id="TANGRAM__PSP_8__idc"><input type="hidden" value="true" name="loginMerge" id="TANGRAM__PSP_8__loginMerge"></p><p style="display:" class="pass-form-item pass-form-item-userName" id="TANGRAM__PSP_8__userNameWrapper"><label class="pass-label pass-label-userName" id="TANGRAM__PSP_8__userNameLabel" for="TANGRAM__PSP_8__userName">手机/邮箱/用户名</label><input type="text" autocomplete="off" class="pass-text-input pass-text-input-userName" name="userName" id="TANGRAM__PSP_8__userName" placeholder="手机/邮箱/用户名"><span style="display: none; visibility: hidden;" class="pass-clearbtn pass-clearbtn-userName" id="TANGRAM__PSP_8__userName_clearbtn"></span><span style="display:none" class="pass-item-tip pass-item-tip-userName" id="TANGRAM__PSP_8__userNameTip"><span class="pass-item-tiptext pass-item-tiptext-userName" id="TANGRAM__PSP_8__userNameTipText"></span></span></p><p style="display:" class="pass-form-item pass-form-item-password" id="TANGRAM__PSP_8__passwordWrapper"><label class="pass-label pass-label-password" id="TANGRAM__PSP_8__passwordLabel" for="TANGRAM__PSP_8__password">密码</label><input type="password" class="pass-text-input pass-text-input-password" name="password" id="TANGRAM__PSP_8__password" placeholder="密码"><span style="display: none; visibility: hidden;" class="pass-clearbtn pass-clearbtn-password" id="TANGRAM__PSP_8__password_clearbtn"></span><span style="display:none" class="pass-item-tip pass-item-tip-password" id="TANGRAM__PSP_8__passwordTip"><span class="pass-item-tiptext pass-item-tiptext-password" id="TANGRAM__PSP_8__passwordTipText"></span></span></p><p style="display:none" class="pass-form-item pass-form-item-verifyCode" id="TANGRAM__PSP_8__verifyCodeImgWrapper"><label class="pass-label pass-label-verifyCode" id="TANGRAM__PSP_8__verifyCodeLabel" for="TANGRAM__PSP_8__verifyCode">验证码</label><input type="text" maxlength="6" class="pass-text-input pass-text-input-verifyCode" name="verifyCode" id="TANGRAM__PSP_8__verifyCode" placeholder="验证码"><span style="display:none;" class="pass-clearbtn pass-clearbtn-verifyCode" id="TANGRAM__PSP_8__verifyCode_clearbtn"></span><span class="pass-verifyCodeImgParent" id="TANGRAM__PSP_8__verifyCodeImgParent"><img src="https://passport.baidu.com/passApi/img/small_blank_5b01ba6e.gif" class="pass-verifyCode" id="TANGRAM__PSP_8__verifyCodeImg"></span><a class="pass-change-verifyCode" href="#" id="TANGRAM__PSP_8__verifyCodeChange">换一张</a><span class="pass-error pass-error-verifyCode" id="TANGRAM__PSP_8__verifyCodeError"></span><span class="pass-tip pass-tip-verifyCode" id="TANGRAM__PSP_8__verifyCodeTip"></span><span class="pass-success pass-success-verifyCode" id="TANGRAM__PSP_8__verifyCodeSuccess"></span></p><p class="pass-form-item pass-form-item-memberPass" id="TANGRAM__PSP_8__memberPassWrapper"><input type="checkbox" checked="checked" class="pass-checkbox-input pass-checkbox-memberPass" name="memberPass" id="TANGRAM__PSP_8__memberPass"><label class="" id="TANGRAM__PSP_8__memberPassLabel" for="TANGRAM__PSP_8__memberPass">下次自动登录</label></p><p class="pass-form-item pass-form-item-submit" id="TANGRAM__PSP_8__submitWrapper"><input type="submit" class="pass-button pass-button-submit" value="登录" id="TANGRAM__PSP_8__submit"><a target="_blank" href="https://passport.baidu.com/v2/?reg&amp;tt=1460449736690&amp;gid=A0E437E-3F83-4CBA-BA0D-66F8F0FAED1D&amp;tpl=mn&amp;u=https%3A%2F%2Fwww.baidu.com%2F" class="pass-reglink">立即注册</a><a target="_blank" href="https://passport.baidu.com/?getpassindex&amp;tt=1460449736690&amp;gid=A0E437E-3F83-4CBA-BA0D-66F8F0FAED1D&amp;tpl=mn&amp;u=https%3A%2F%2Fwww.baidu.com%2F" class="pass-fgtpwd">登录遇到问题</a></p></form>';
        }
    }

    public function actionT3 ()
    {
        $cookie_folder = dirname ( __FILE__ ) . "/temp";
        $lines = $cookie_folder . '/coo3A02.tmp';
        $get3 = 'https://log.mmstat.com/member.2.1.2?ok=1';
        $this->vget ( $get3 , $lines );
        $url123='http://www.alimama.com/member/ajax_login.htm?forward=http%3A%2F%2Fwww.alimama.com%2Findex.htm&callback=__jp2';
        $this->vget($url123,$lines);
        $get1 = 'http://www.alimama.com/member/ajax_login.htm?forward=http%3A%2F%2Fwww.alimama.com%2Findex.htm&callback=__jp1';
        $this->vget ( $get1 , $lines );
        $posturl='https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3D1';

        $post = 'https://login.taobao.com/member/request_nick_check.do';
        $post2 = array ( 'username' => '132712115815' , 'ua' => '061#ULViTsiaiskiBJiyiiiiiVsBSomanp3hqcP5HOL48sOr0tOqGVUs/g+B2oFCn7oqqJ77HxcpMncD0tOFGcVwFnEB2QU6m0i/iimRnJYxonVifxKp3A5GhKC6lPWM9X1ER4auPG/FfnVixtoz/adRiisQ2e3U+ffgn/em/4VzTxud/8axonVi/kKp3A5rTdF/i/j6uhbYTiiQ0DNdPodmgFiNH/rzuI/oNd6Cm6F/iiTIdA4ESPxHinixd2NWyuJmfnViVD/zNu12iisQ2K8X+fok4FMxiniBRsL1AsyCI8iRgGx3snY/iiz80xjA05vMjAEgvGW//JVi0nvQGw3DKL7wygOLwQVxiniBRsLeAsLCIXApgGx3snY/iiz80hGA0IvMj32gvGW//JViRn3BpAeKKLaY7kY/i/o0K5RZbex0ybzUiG+LeX+2KVadJMjZ7ZaCll3/iimbG/in4nVi/HUTBtj4arn/iRdxBDXTH2uSKVYz2ZXpHy1Bmbq5vrKp9IdxBDKLH2KSczYz2SxpHC1ggJVi/6jEh//YOcJ/iidOgwQy9RmedTc/iR7LomJQMJGgoYtKBzSzg3Zb5vgy0+2/EKGrLOsMhieDy2AluLkEnMlPLr2vpCS/iiPsQ7kiiMGRQGyluxdjQiVi/VUR/JYxiniU0sPOA2fCxE1v/JViRn3B9AecKLaYZnY/iic40/0AopvGOnMxiniU0ssnA2BCxE+D/JVi0nvQXAyeKL7tyHOLwQ3xiniBRsLZAsLCIXANgGx3snY/iiz80I8A0pvMjemgvGW//JVi0nvQMw3DKL7wCfOLwQVxiniBRsL+AsyCI8iXgGx3snY/iiz80fCARIvMv/BgvGW//JVi0nvQOw3hKL7shfOLwQVxiniBRsLTAsHCI8iLgGx3sqi/iimRnJYxQiVi/VUR/JTHiniFr2NWeuH7Cto8NBXzajYmRTCBvfnsiniVnchx/6F/i/m5dA429LqtZca3zjl9adVUjv9sgQV/i/FhUX+oiVaHUgrkykQSQnFNrz5QcLN/inigRRlo6n/857gOT4T0D0VfI9uUWUQpQiVi/VUR/JG/inigRR9o6n/4VRgOT4T0D0VfI9uUWUQpQiVi/VUR/JY=' );
        $this->vlogin ( $post , $post2 , $lines );
        $get = 'https://login.taobao.com/member/login.jhtml';
        $this->vget ( $get , $lines );
        $get1 = 'https://log.mmstat.com/member.2.1.4';
        $this->vget ( $get1 , $lines );
        $get2 = 'http://log.mmstat.com/o.gif?logtype=1&title=%uFFFD%u0531%uFFFD%uFFFD%uFFFD%20-%20%uFFFD%u0523%uFFFD%uFFFD%uFFFD%u03F2%uFFFD%uFFFD&pre=http%3A%2F%2Fy.com%2Ftest%2Ft3&cache=7a3ff97&scr=1366x768&spm-cnt=a2107.1.0.0.OhXtnS&category=&uidaplus=&aplus&yunid=&CtB1fubJDWzkWw4&trid=0ab22dad14604451659758854e&asid=AQAAAADtnwxX3WuPdAAAAAA7NkrX1moBbg==&isbeta=7&p=1&o=win7&b=firefox45&s=1366x768&w=gecko&ism=pc&lver=6.1.5&fp=f778028ae2ecfc42111dcb470c7b32af&fp2=5ccb0a2a85f931978b2499333153b1a6';
        $this->vget ( $get2 , $lines );
        $get5 = 'http://cf.aliyun.com/nocaptcha/analyze.jsonp?a=CF_APP_TBLogin_PC&t=7916c0ce43e09f108c0c37e39b7f63c4d90716e1&n=061%23ULVidsi1ichiBJiyiiiiiVsBSomanps%2F0cP5c9o4NJHQbGKFDd%2FyiEcQCMUkmpfq0Bb5cWLxMf8B%2BKXpDcVaRnWB2rh3mXF%2FiiYf%2FBInJDvIiniBRs7RAsmCI%2Fp3gGx3snM%2Fiiz80hjAKpvMfNmgvGW%2F%2FsVi0nvQbwyeKLsFGgOLwQ3IiniBRsLeAP2CI%2FmkgGx3WsM%2Fiiz80I8AR5vMff2gvGW%2F%2FsVi0nvQYw3XKLsFOHOLwQVIiniBRsLDAsoCI%2FmXgGx3snM%2Fiiz80V8AR5vMf0%2FgvGW%2F%2FsVi0nvQBw3uKLsFhfOLwQVIiniBRss1ALBCI%2FnngGx3sTF%2FiiYf%2FuIntX1Hinix%2FnpmzVtw%2FsVi0scD%2BNtkKLsoExxBNu3KbnM%2Fiic40tqCbPvMXGVIiniq%2FnLje92CxEx5npFoE%2F7V1FH%2B9O3%2FiinPCFUj4nVi%2FJVU8tASc%2FM%2FiiT6ylinOfohinihgHGW4ubdTYTFinikVLDOLB7K8lzqV242PUStCmQqcejM51StVLDqZa7K8AMqV24TPUSwLeJ%2FiR7LomJQMJGgoYtKBzSzg3Zb5vgy0%2B2%2FEKGrLOsMhieDy2AluLkEnMlPLr2vpCS%2Fiis9nC%2B2mFvhlZds2risiniVAwSnchY%2Fi%2FkbhC01IJzxaHzt5khJX6q%2FxR%2BldgaqJthGXiM%2Fii3U0s4C3IvGK%2BfdbpPNIkzIini4RnCgeCyCIR59YYEyPLZBonVi%2FJFVzu%2FUGXF%2FiiYf%2FBInzuvIiniBRss6ALECI%2FnkgGx3snM%2Fiiz80fjAR5vMfVygvGW%2F%2FsVi0nvQKw3fKLsOREOLwQVginindaXU1QA4q%2BT08gfmhcLAI0i%2FiiqeAdRn&p=%7B%22behaviorTraceId%22%3A%227cc714070baf40e7a4167b18c0ed8c00%22%2C%22TPL_username_1%22%3A%2213271215815%22%7D&scene=&asyn=0&lang=cn&v=12&callback=jsonp_03137308473889495';
        $this->vget ( $get5 , $lines );
        $get3 = 'https://log.mmstat.com/member.2.1.2?ok=1';
        $this->vget ( $get3 , $lines );
        if (\Yii::$app->request->isPost) {

            $posturl='https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3D1';

            $post = 'https://login.taobao.com/member/request_nick_check.do';
            $post2 = array ( 'username' => '132712115815' , 'ua' => '061#ULViTsiaiskiBJiyiiiiiVsBSomanp3hqcP5HOL48sOr0tOqGVUs/g+B2oFCn7oqqJ77HxcpMncD0tOFGcVwFnEB2QU6m0i/iimRnJYxonVifxKp3A5GhKC6lPWM9X1ER4auPG/FfnVixtoz/adRiisQ2e3U+ffgn/em/4VzTxud/8axonVi/kKp3A5rTdF/i/j6uhbYTiiQ0DNdPodmgFiNH/rzuI/oNd6Cm6F/iiTIdA4ESPxHinixd2NWyuJmfnViVD/zNu12iisQ2K8X+fok4FMxiniBRsL1AsyCI8iRgGx3snY/iiz80xjA05vMjAEgvGW//JVi0nvQGw3DKL7wygOLwQVxiniBRsLeAsLCIXApgGx3snY/iiz80hGA0IvMj32gvGW//JViRn3BpAeKKLaY7kY/i/o0K5RZbex0ybzUiG+LeX+2KVadJMjZ7ZaCll3/iimbG/in4nVi/HUTBtj4arn/iRdxBDXTH2uSKVYz2ZXpHy1Bmbq5vrKp9IdxBDKLH2KSczYz2SxpHC1ggJVi/6jEh//YOcJ/iidOgwQy9RmedTc/iR7LomJQMJGgoYtKBzSzg3Zb5vgy0+2/EKGrLOsMhieDy2AluLkEnMlPLr2vpCS/iiPsQ7kiiMGRQGyluxdjQiVi/VUR/JYxiniU0sPOA2fCxE1v/JViRn3B9AecKLaYZnY/iic40/0AopvGOnMxiniU0ssnA2BCxE+D/JVi0nvQXAyeKL7tyHOLwQ3xiniBRsLZAsLCIXANgGx3snY/iiz80I8A0pvMjemgvGW//JVi0nvQMw3DKL7wCfOLwQVxiniBRsL+AsyCI8iXgGx3snY/iiz80fCARIvMv/BgvGW//JVi0nvQOw3hKL7shfOLwQVxiniBRsLTAsHCI8iLgGx3sqi/iimRnJYxQiVi/VUR/JTHiniFr2NWeuH7Cto8NBXzajYmRTCBvfnsiniVnchx/6F/i/m5dA429LqtZca3zjl9adVUjv9sgQV/i/FhUX+oiVaHUgrkykQSQnFNrz5QcLN/inigRRlo6n/857gOT4T0D0VfI9uUWUQpQiVi/VUR/JG/inigRR9o6n/4VRgOT4T0D0VfI9uUWUQpQiVi/VUR/JY=' );
            $this->vlogin ( $post , $post2 , $lines );
            $get = 'https://login.taobao.com/member/login.jhtml';
            $this->vget ( $get , $lines );
            $get1 = 'https://log.mmstat.com/member.2.1.4';
            $this->vget ( $get1 , $lines );
            $get2 = 'http://log.mmstat.com/o.gif?logtype=1&title=%uFFFD%u0531%uFFFD%uFFFD%uFFFD%20-%20%uFFFD%u0523%uFFFD%uFFFD%uFFFD%u03F2%uFFFD%uFFFD&pre=http%3A%2F%2Fy.com%2Ftest%2Ft3&cache=7a3ff97&scr=1366x768&spm-cnt=a2107.1.0.0.OhXtnS&category=&uidaplus=&aplus&yunid=&CtB1fubJDWzkWw4&trid=0ab22dad14604451659758854e&asid=AQAAAADtnwxX3WuPdAAAAAA7NkrX1moBbg==&isbeta=7&p=1&o=win7&b=firefox45&s=1366x768&w=gecko&ism=pc&lver=6.1.5&fp=f778028ae2ecfc42111dcb470c7b32af&fp2=5ccb0a2a85f931978b2499333153b1a6';
            $this->vget ( $get2 , $lines );
            $get5 = 'http://cf.aliyun.com/nocaptcha/analyze.jsonp?a=CF_APP_TBLogin_PC&t=7916c0ce43e09f108c0c37e39b7f63c4d90716e1&n=061%23ULVidsi1ichiBJiyiiiiiVsBSomanps%2F0cP5c9o4NJHQbGKFDd%2FyiEcQCMUkmpfq0Bb5cWLxMf8B%2BKXpDcVaRnWB2rh3mXF%2FiiYf%2FBInJDvIiniBRs7RAsmCI%2Fp3gGx3snM%2Fiiz80hjAKpvMfNmgvGW%2F%2FsVi0nvQbwyeKLsFGgOLwQ3IiniBRsLeAP2CI%2FmkgGx3WsM%2Fiiz80I8AR5vMff2gvGW%2F%2FsVi0nvQYw3XKLsFOHOLwQVIiniBRsLDAsoCI%2FmXgGx3snM%2Fiiz80V8AR5vMf0%2FgvGW%2F%2FsVi0nvQBw3uKLsFhfOLwQVIiniBRss1ALBCI%2FnngGx3sTF%2FiiYf%2FuIntX1Hinix%2FnpmzVtw%2FsVi0scD%2BNtkKLsoExxBNu3KbnM%2Fiic40tqCbPvMXGVIiniq%2FnLje92CxEx5npFoE%2F7V1FH%2B9O3%2FiinPCFUj4nVi%2FJVU8tASc%2FM%2FiiT6ylinOfohinihgHGW4ubdTYTFinikVLDOLB7K8lzqV242PUStCmQqcejM51StVLDqZa7K8AMqV24TPUSwLeJ%2FiR7LomJQMJGgoYtKBzSzg3Zb5vgy0%2B2%2FEKGrLOsMhieDy2AluLkEnMlPLr2vpCS%2Fiis9nC%2B2mFvhlZds2risiniVAwSnchY%2Fi%2FkbhC01IJzxaHzt5khJX6q%2FxR%2BldgaqJthGXiM%2Fii3U0s4C3IvGK%2BfdbpPNIkzIini4RnCgeCyCIR59YYEyPLZBonVi%2FJFVzu%2FUGXF%2FiiYf%2FBInzuvIiniBRss6ALECI%2FnkgGx3snM%2Fiiz80fjAR5vMfVygvGW%2F%2FsVi0nvQKw3fKLsOREOLwQVginindaXU1QA4q%2BT08gfmhcLAI0i%2FiiqeAdRn&p=%7B%22behaviorTraceId%22%3A%227cc714070baf40e7a4167b18c0ed8c00%22%2C%22TPL_username_1%22%3A%2213271215815%22%7D&scene=&asyn=0&lang=cn&v=12&callback=jsonp_03137308473889495';
            $this->vget ( $get5 , $lines );
            $get3 = 'https://log.mmstat.com/member.2.1.2?ok=1';
            $this->vget ( $get3 , $lines );
            $dataname = Yii::$app->request->post ( 'username' );
            $data = array (
                'TPL_username' => $dataname ,
                'TPL_password' => 'liwei13271215815..' ,
                'ncoSig' => '' ,
                'ncoSessionid' => '' ,
                'ncoToken' => '109373b382bf5de78d6f2b4609c932c42772c2f3' ,
                'slideCodeShow' => 'false' ,
                'loginsite' => '0' ,
                'newlogin' => '' ,
                'TPL_redirect_url' => 'https://www.taobao.com/' ,
                'from' => 'tb' ,
                'fc' => 'default' ,
                'style' => 'default' ,
                'css_style' => '' ,
                'keyLogin' => 'false' ,
                'qrLogin' => 'true' ,
                'newMini' => 'false' ,
                'newMini2' => 'false' ,
                'tid' => '' ,
                'loginType' => '3' ,
                'minititle' => '' ,
                'minipara' => '' ,
                'pstrong' => '' ,
                'sign' => '' ,
                'need_sign' => '' ,
                'isIgnore' => '' ,
                'full_redirect' => '' ,
                'popid' => '' ,
                'callback' => '' ,
                'guf' => '' ,
                'not_duplite_str' => '' ,
                'need_user_id' => '' ,
                'poy' => '' ,
                'gvfdcname' => '10' ,
                'gvfdcre' => '' ,
                'from_encoding' => '' ,
                'sub' => 'false' ,
                'TPL_password_2' => '6a75678dac056ea15764b9a0f6e3c8e1e36cf5e2358c4b76bff9b15086d9a2475add179111807b110185bc25bc668f33ceb679b99a374d5a58dc0fee805fc687970f6025e5aebf5c2f2009973be6c08d64c3267fccf9701c00529de098977801604ef3510f3ba65de436178b2de5f2875db3edd1507b1b8d5f2b723ce9b10e7e' ,
                'loginASR' => '1' ,
                'loginASRSuc' => '0' ,
                'allp' => '' ,
                'oslanguage' => 'zh-CN' ,
                'sr' => '1366*768' ,
                'osVer' => 'windows|6.1' ,
                'naviVer' => 'firefox|45' ,
                'ua' => '061#ULViDJiqiKViBJiyiiiiiVsBSomomPJhWiPccOE4Ki/DWDDpDzrLio1rSMi3n5fFbr5+L+E0Kn5YqtKODcfC/39Qa2YAm6n/iirpOSETRG3ginildB8isKwoq+TRTb3AB9JhRNR3/sViRG9Sd5UmG23G16n/iirpOkETs/hIiniUwGZ9YJyw52/QdsVix10AffzXi5Uy9Mc+4qnHpRCVs0h9qEsZ4e0YGsVi/IoWinVsiniVAwSncXc/iQhbJkwT2TuVnUruoXjdwfurcgIA2DXLFgymdtqkkj2gpYOheTjdwfurcgIdCN+epieg1DAvACrqmIdELCbHozmiHc12v8ZlfnUYgM9JweYRuo6TAXw2vHyldUXH2tXefnUYgMPaeTuinEEloD51afHKFrN6Zte7pLZxctT6S8ruFk1goD51afHKFYPb3KRA0zXhde8PZ8/VrpgwatP2oz/0lfOeavW9iJggTTZPtDf9m26ToNIvwfUmcHIkZt09iJgg' ,
                'um_token' => 'HV01PAAZ0ab2a1c1246e0df3570625d500054482' );
            $data = http_build_query ( $data );
            $url = 'https://login.taobao.com/member/login.jhtml?redirectURL=http%3A%2F%2Flogin.taobao.com%2Fmember%2Ftaobaoke%2Flogin.htm%3Fis_login%3D1';
//            $getn='http://cf.aliyun.com/nocaptcha/analyze.jsonp?a=CF_APP_TBLogin_PC&t=791610ce4ae09f308c0b37e33b7f64c4d95716ee&n=061%23ULVitsiHi%2BviBJiyiiiiiVsBSomomP3R0FWdH%2BL4NJHQbKOFDd%2FyFgcQCMU6mpfq0Ub5cWLxKH8B%2BKXnDcVaRFPB2rh3V0i%2FiiqeAdRnfnViVhGl1YbX7c2%2BJ%2BeStRUQNLsIiniBRsLRAPyCxyKVgGx3sqi%2FiiqeAdRnfnVifh8qt8oYOc2%2BJ52MppP5vF1ioL7c%2FsVi0nvQuw3XKLtYnfOLwQVIiniBRsLZAsHCx2FngGx3snM%2Fiiz80IjARIvGHnBgvGW%2F%2FsVi0nvQKw34KLtFAHOLwQVIiniBRsLeAsECx2qsgGx3snM%2Fiiz80h8A0IvGHB2gvGW%2F%2FsVi0nvQ1w3RKLtFzgOLwQIHinix%2FnpmzYBd%2FsVi0scQZAyyKLvbEcfEVunU1DJ%2FiRs3Azr%2FhiYt6sGVTlL%2BVqO9V23bUbLu8tdF5WhHMHEEkdXhXqd5%2FbeklQn7rcJ%2FiidOgwQ2EMhG5mM%2FiiTbk9L1uIOFinikVLDOPu7K8lzqV242PUStCmQqcejM51StVLDqZa7K8AMqV24TPUSwLC3%2Fi%2FIqzzLQ8HqT6DD0xP%2F2FD0mZWz%2FiirlObG6WCFsiniVAwSncx3%2FiinPCFUjdJVix1QbvDhK0nT9plZKJ1i6oQVYXrXfOEDRzdQc%2FsViVsFQWNybKLvb1cfEXunMdhHUracIini4RnLGAPgCx7DsnpFmEi%2Bh%2FsViRn38V4ySKLvbynM%2Fiic4RLqAKPvGU00Hinix%2FnqmzOph2nVi%2FJFfzuVxNDF%2FiiYf%2FBImXM0Hinix%2FnpmzKou%2FsVi0nvQKw3DKLtFefOLwQVIiniBRsLZAsoCx2FjgGx3snM%2Fiiz80fCAiPvG%2BffgvGW%2F%2FsVi0nvQ4wy2KLtYgfOLwQIHinix%2Fnqmzurj%2FsVi0nvQ4wyeKLwpMEOLwQ3%3D&p={%22behaviorTraceId%22%3A%22171b6444fafd8d9c2930eb7311c1f872%22%2C%22TPL_username_1%22%3A%2213271215815%22}&scene=&asyn=0&lang=cn&v=12&callback=jsonp_08556034756358653';
//           $this->vget($getn,$lines);
            return $this->vlogin ( 'https://login.taobao.com/member/login.jhtml' , $data , $lines );
        }
        ECHO '<form id="J_Form" method="post" action="">
<input type="text" name="username"/>
<input type="submit" value="denglu"/>
  </form>';

    }

}



